<?php

/* 
 * 把修改后的留言保存数据库里
 */
require 'isok.php';
require 'dbcon.php';
$id=$_GET['id'];
$title=$_REQUEST['title'];
$content=$_REQUEST['content'];
$slug=$_REQUEST['slug'];
$feature=$_REQUEST['feature'];
$category_id=$_REQUEST['category_id'];
$created=$_REQUEST['created'];
$status=$_REQUEST['status'];
$sql="update posts set title='{$title}',content='{$content}' ,slug='{$slug}',feature='{$feature}',category_id='{$category_id}',created='{$created}',status='{$status}'  where id={$id}";
$rs=$db->query($sql);//执行查询语句$sql，生成结果集$result
$db->close();//关闭数据库连接
if ($rs==true)
{
    header("Location:posts_html.php");
}
else   
{
    echo "<script type='text/javascript'>";  
    echo "alert('修改文章失败！');";
    echo "window.location.href='posts.php'";
    echo "</script>";
}

